<?xml version="1.0" encoding="UTF-8"?>
<web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee"
         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
         xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/javaee
         http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd"
         version="3.1">
  <context-param>
    <param-name>com.serotonin.web.taglib.ListSortTag.styleClass</param-name>
    <param-value>rowHeaderLink</param-value>
  </context-param>
  <context-param>
    <param-name>com.serotonin.web.taglib.ListSortTag.imageAlign</param-name>
    <param-value>top</param-value>
  </context-param>
  <context-param>
    <param-name>com.serotonin.web.taglib.ListSortTag.upImage.src</param-name>
    <param-value>images/icon_arrow_up.png</param-value>
  </context-param>
  <context-param>
    <param-name>com.serotonin.web.taglib.ListSortTag.upImage.width</param-name>
    <param-value>16</param-value>
  </context-param>
  <context-param>
    <param-name>com.serotonin.web.taglib.ListSortTag.upImage.height</param-name>
    <param-value>16</param-value>
  </context-param>
  <context-param>
    <param-name>com.serotonin.web.taglib.ListSortTag.upImage.altKey</param-name>
    <param-value>pagination.ascending</param-value>
  </context-param>
  <context-param>
    <param-name>com.serotonin.web.taglib.ListSortTag.downImage.src</param-name>
    <param-value>images/icon_arrow_down.png</param-value>
  </context-param>
  <context-param>
    <param-name>com.serotonin.web.taglib.ListSortTag.downImage.width</param-name>
    <param-value>16</param-value>
  </context-param>
  <context-param>
    <param-name>com.serotonin.web.taglib.ListSortTag.downImage.height</param-name>
    <param-value>16</param-value>
  </context-param>
  <context-param>
    <param-name>com.serotonin.web.taglib.ListSortTag.downImage.altKey</param-name>
    <param-value>pagination.descending</param-value>
  </context-param>

  <!-- Log4j2 -->
  <context-param>
    <param-name>isLog4jAutoInitializationDisabled</param-name>
    <param-value>true</param-value>
  </context-param>
  <listener>
    <listener-class>org.apache.logging.log4j.web.Log4jServletContextListener</listener-class>
  </listener>
  <filter>
    <filter-name>log4jServletFilter</filter-name>
    <filter-class>org.apache.logging.log4j.web.Log4jServletFilter</filter-class>
  </filter>
  <filter-mapping>
    <filter-name>log4jServletFilter</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>FORWARD</dispatcher>
    <dispatcher>INCLUDE</dispatcher>
    <dispatcher>ERROR</dispatcher>
    <dispatcher>ASYNC</dispatcher>
  </filter-mapping>
  <!-- END Log4j2 -->

  <!-- secure javamelody -->
  <login-config>
    <auth-method>DIGEST</auth-method>
    <realm-name>Monitoring</realm-name>
  </login-config>
  <security-role>
    <role-name>monitoring</role-name>
  </security-role>
  <security-constraint>
    <web-resource-collection>
        <web-resource-name>Monitoring</web-resource-name>
        <url-pattern>/monitoring</url-pattern>
    </web-resource-collection>
    <auth-constraint>
        <role-name>monitoring</role-name>
    </auth-constraint>
  </security-constraint>
  <!-- end secure javamelody -->
  <filter>  
    <filter-name>encodingFilter</filter-name>  
    <filter-class>org.springframework.web.filter.CharacterEncodingFilter</filter-class>
    <async-supported>true</async-supported>
    <init-param>  
       <param-name>encoding</param-name>  
       <param-value>UTF-8</param-value>  
    </init-param>  
    <init-param>  
       <param-name>forceEncoding</param-name>  
       <param-value>true</param-value>  
    </init-param>  
  </filter>  
  
  <filter>
    <filter-name>CharacterSet</filter-name>
    <filter-class>com.serotonin.web.filter.CharacterSetFilter</filter-class>
    <async-supported>true</async-supported>
    <init-param>
      <param-name>charset</param-name>
      <param-value>UTF-8</param-value>
    </init-param>
  </filter>
  <filter>
    <filter-name>WebContext</filter-name>
    <filter-class>com.serotonin.mango.web.filter.WebContextFilter</filter-class>
    <async-supported>true</async-supported>
  </filter>
  <filter>
    <filter-name>CacheHeaders</filter-name>
    <filter-class>com.serotonin.mango.web.filter.HttpResponseHeaderFilter</filter-class>
    <async-supported>true</async-supported>
    <init-param>
      <param-name>Cache-Control</param-name>
      <param-value>max-age=5184000</param-value>
    </init-param>
  </filter>
  <filter>
    <filter-name>monitoring</filter-name>
    <filter-class>net.bull.javamelody.MonitoringFilter</filter-class>
    <async-supported>true</async-supported>
  </filter>

  <!-- Spring Security -->
  <filter>
    <filter-name>springSecurityFilterChain</filter-name>
    <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class>
    <async-supported>true</async-supported>
  </filter>

  <filter-mapping>
    <filter-name>springSecurityFilterChain</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

  <context-param>
    <param-name>contextConfigLocation</param-name>
    <param-value>
      /WEB-INF/applicationContext.xml
      /WEB-INF/spring-security.xml
    </param-value>
  </context-param>
  <!-- End spring security -->

  
  <filter-mapping>  
    <filter-name>encodingFilter</filter-name>  
    <url-pattern>/*</url-pattern>  
  </filter-mapping>

  <filter-mapping>
    <filter-name>CharacterSet</filter-name>
    <url-pattern>*.htm</url-pattern>
  </filter-mapping>
  <filter-mapping>
    <filter-name>CharacterSet</filter-name>
    <url-pattern>*.shtm</url-pattern>
  </filter-mapping>
  <filter-mapping>
    <filter-name>WebContext</filter-name>
    <url-pattern>*.shtm</url-pattern>
  </filter-mapping>
  <filter-mapping>
    <filter-name>WebContext</filter-name>
    <url-pattern>*.mp3</url-pattern>
  </filter-mapping>
  <filter-mapping>
    <filter-name>CacheHeaders</filter-name>
    <url-pattern>/dwr/interfaces/*</url-pattern>
  </filter-mapping>
  <filter-mapping>
    <filter-name>CacheHeaders</filter-name>
    <url-pattern>/dwr/engine.js</url-pattern>
  </filter-mapping>
  <filter-mapping>
    <filter-name>CacheHeaders</filter-name>
    <url-pattern>/dwr/utils.js</url-pattern>
  </filter-mapping>
  <filter-mapping>
    <filter-name>CacheHeaders</filter-name>
    <url-pattern>/audio/*</url-pattern>
  </filter-mapping>
  <filter-mapping>
    <filter-name>CacheHeaders</filter-name>
    <url-pattern>/images/*</url-pattern>
  </filter-mapping>
  <filter-mapping>
    <filter-name>CacheHeaders</filter-name>
    <url-pattern>/graphics/*</url-pattern>
  </filter-mapping>
  <filter-mapping>
    <filter-name>CacheHeaders</filter-name>
    <url-pattern>/graphics/GreenThermo/*</url-pattern>
  </filter-mapping>
  <filter-mapping>
    <filter-name>CacheHeaders</filter-name>
    <url-pattern>/resources/*</url-pattern>
  </filter-mapping>
  <filter-mapping>
    <filter-name>CacheHeaders</filter-name>
    <url-pattern>/uploads/*</url-pattern>
  </filter-mapping>
  <filter-mapping>
    <filter-name>CacheHeaders</filter-name>
    <url-pattern>/assets/*</url-pattern>
  </filter-mapping>
  <filter-mapping>
    <filter-name>monitoring</filter-name>
    <url-pattern>/*</url-pattern>
  </filter-mapping>

  <servlet>
    <servlet-name>springDispatcher</servlet-name>
    <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class>
    <load-on-startup>1</load-on-startup>
    <async-supported>true</async-supported>
  </servlet>
  <servlet>
    <servlet-name>dwr-invoker</servlet-name>
    <servlet-class>org.directwebremoting.servlet.DwrServlet</servlet-class>
    <init-param>
      <param-name>debug</param-name>
      <param-value>false</param-value>
    </init-param>
    <init-param>
      <param-name>publishContainerAs</param-name>
      <param-value>DwrContainer</param-value>
    </init-param>
    <init-param>
      <param-name>crossDomainSessionSecurity</param-name>
      <param-value>false</param-value>
    </init-param>
    <load-on-startup>2</load-on-startup>
    <async-supported>true</async-supported>
  </servlet>
  <servlet>
    <servlet-name>imageChart</servlet-name>
    <servlet-class>com.serotonin.mango.web.servlet.ImageChartServlet</servlet-class>
    <async-supported>true</async-supported>
  </servlet>
  <servlet>
     <servlet-name>enhancedImageChart</servlet-name>
     <servlet-class>com.serotonin.mango.web.servlet.EnhancedImageChartServlet</servlet-class>
    <async-supported>true</async-supported>
  </servlet>
  <servlet>
    <servlet-name>asyncImageChart</servlet-name>
    <servlet-class>com.serotonin.mango.web.servlet.AsyncImageChartServlet</servlet-class>
    <async-supported>true</async-supported>
  </servlet>
  <servlet>
    <servlet-name>reportExport</servlet-name>
    <servlet-class>com.serotonin.mango.web.servlet.ReportExportServlet</servlet-class>
    <async-supported>true</async-supported>
  </servlet>
  <servlet>
    <servlet-name>reportEventExport</servlet-name>
    <servlet-class>com.serotonin.mango.web.servlet.ReportEventExportServlet</servlet-class>
    <async-supported>true</async-supported>
  </servlet>
  <servlet>
    <servlet-name>reportUserCommentExport</servlet-name>
    <servlet-class>com.serotonin.mango.web.servlet.ReportUserCommentExportServlet</servlet-class>
    <async-supported>true</async-supported>
  </servlet>
  <servlet>
    <servlet-name>reportChart</servlet-name>
    <servlet-class>com.serotonin.mango.web.servlet.ReportChartServlet</servlet-class>
    <async-supported>true</async-supported>
  </servlet>
  <servlet>
    <servlet-name>httpDataSource</servlet-name>
    <servlet-class>com.serotonin.mango.web.servlet.HttpDataSourceServlet</servlet-class>
    <async-supported>true</async-supported>
  </servlet>
  <servlet>
    <servlet-name>httpDataSourceSecure</servlet-name>
    <servlet-class>com.serotonin.mango.web.servlet.HttpDataSourceServlet</servlet-class>
    <async-supported>true</async-supported>
  </servlet>
  <servlet>
    <servlet-name>imageValue</servlet-name>
    <servlet-class>com.serotonin.mango.web.servlet.ImageValueServlet</servlet-class>
    <async-supported>true</async-supported>
  </servlet>
 
  <servlet-mapping>
    <servlet-name>springDispatcher</servlet-name>
    <url-pattern>*.htm</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>*.map</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>springDispatcher</servlet-name>
    <url-pattern>*.shtm</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>springDispatcher</servlet-name>
    <url-pattern>*.png</url-pattern>
  </servlet-mapping>
    <servlet-mapping>
        <servlet-name>springDispatcher</servlet-name>
        <url-pattern>*.jpg</url-pattern>
    </servlet-mapping>
  <servlet-mapping>
    <servlet-name>springDispatcher</servlet-name>
    <url-pattern>*.bmp</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>*.css</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>*.js</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>*.woff2</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>*.woff</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>*.ttf</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>*.ico</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>*.fla</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>springDispatcher</servlet-name>
    <url-pattern>*.gif</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>springDispatcher</servlet-name>
    <url-pattern>*.jpeg</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>springDispatcher</servlet-name>
    <url-pattern>*.svg</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>*.swf</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>default</servlet-name>
    <url-pattern>*.mp3</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>springDispatcher</servlet-name>
    <url-pattern>/</url-pattern>
  </servlet-mapping>

  <servlet-mapping>
    <servlet-name>dwr-invoker</servlet-name>
    <url-pattern>/dwr/*</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>imageChart</servlet-name>
    <url-pattern>/chart/*</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>asyncImageChart</servlet-name>
    <url-pattern>/achart/*</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>reportChart</servlet-name>
    <url-pattern>/reportImageChart/*</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>reportExport</servlet-name>
    <url-pattern>/export/*</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>reportEventExport</servlet-name>
    <url-pattern>/eventExport/*</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>reportUserCommentExport</servlet-name>
    <url-pattern>/userCommentExport/*</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>httpDataSource</servlet-name>
    <url-pattern>/httpds</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>httpDataSourceSecure</servlet-name>
    <url-pattern>/httpds-secure</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>imageValue</servlet-name>
    <url-pattern>/imageValue/*</url-pattern>
  </servlet-mapping>
 
  <servlet-mapping>
  	<servlet-name>enhancedImageChart</servlet-name>
    <url-pattern>/enhChart</url-pattern>
  </servlet-mapping>
  <filter-mapping>
    <filter-name>javamelody</filter-name>
    <url-pattern>/*</url-pattern>
    <dispatcher>REQUEST</dispatcher>
    <dispatcher>ASYNC</dispatcher>
  </filter-mapping>
  <listener>
    <listener-class>net.bull.javamelody.SessionListener</listener-class>
  </listener>
  <listener>
    <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class>
  </listener>
  <listener>
    <listener-class>org.springframework.security.web.session.HttpSessionEventPublisher</listener-class>
  </listener>
  <session-config>
    <session-timeout>30</session-timeout>
  </session-config>
  <welcome-file-list>
    <welcome-file>home.jsp</welcome-file>
    <welcome-file>index.jsp</welcome-file>
  </welcome-file-list>
  <servlet>
    <display-name>Apache-Axis Servlet</display-name>
    <servlet-name>AxisServlet</servlet-name>
    <servlet-class>org.apache.axis.transport.http.AxisServlet</servlet-class>
    <async-supported>true</async-supported>
  </servlet>
  <servlet-mapping>
    <servlet-name>AxisServlet</servlet-name>
    <url-pattern>/servlet/AxisServlet</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>AxisServlet</servlet-name>
    <url-pattern>*.jws</url-pattern>
  </servlet-mapping>
  <servlet-mapping>
    <servlet-name>AxisServlet</servlet-name>
    <url-pattern>/services/*</url-pattern>
  </servlet-mapping>
  <servlet>
    <display-name>Axis Admin Servlet</display-name>
    <servlet-name>AdminServlet</servlet-name>
    <servlet-class>org.apache.axis.transport.http.AdminServlet</servlet-class>
    <load-on-startup>100</load-on-startup>
    <async-supported>true</async-supported>
  </servlet>
  <servlet-mapping>
    <servlet-name>AdminServlet</servlet-name>
    <url-pattern>/servlet/AdminServlet</url-pattern>
  </servlet-mapping>
  <error-page>
    <exception-type>com.serotonin.mango.vo.permission.PermissionException</exception-type>
    <location>/exception/accessDenied.jsp</location>
  </error-page>
  <error-page>
    <error-code>500</error-code>
    <location>/exception/error.jsp</location>
  </error-page>
  <error-page>
    <error-code>404</error-code>
    <location>/exception/404.jsp</location>
  </error-page>
</web-app>
